---------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\user\Documents\work/DNB_survey_consumption/ConGrowth/Replication/Programs/IV/Cons_Unc_IV_boot1000_tri
> o.log
  log type:  text
 opened on:  14 Dec 2018, 11:43:28
Results for outcome w005_hpconch_nyr, treatm. w005_hmtrio_sqcgr, IV , spec.1
Conventional IV regression
(running ivregress on estimation sample)

Bootstrap replications (1000)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250
..................................................   300
..................................................   350
..................................................   400
..................................................   450
..................................................   500
..................................................   550
..................................................   600
..................................................   650
..................................................   700
..................................................   750
..................................................   800
..................................................   850
..................................................   900
..................................................   950
..................................................  1000

Instrumental variables (LIML) regression               Number of obs =    2791
                                                       Wald chi2(11) =   21.00
                                                       Prob > chi2   =  0.0334
                                                       R-squared     =  0.1540
                                                       Root MSE      =  .08221

                                   (Replications based on 1495 clusters in nohhold)
-----------------------------------------------------------------------------------
                  |   Observed   Bootstrap                         Normal-based
 w005_hpconch_nyr |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
w005_hmtrio_sqcgr |   .8618554   .5121302     1.68   0.092    -.1419014    1.865612
              age |  -9.11e-06   .0001228    -0.07   0.941    -.0002497    .0002315
              fem |  -.0002156   .0038599    -0.06   0.955    -.0077809    .0073497
           dwave2 |   -.004661   .0040404    -1.15   0.249      -.01258     .003258
           dwave3 |    .006429   .0034553     1.86   0.063    -.0003434    .0132014
            dreg2 |  -.0009737   .0059105    -0.16   0.869     -.012558    .0106106
            dreg3 |  -.0051889   .0078641    -0.66   0.509    -.0206022    .0102244
            dreg4 |   .0040633     .00594     0.68   0.494     -.007579    .0157055
            dreg5 |  -.0053846   .0063855    -0.84   0.399    -.0178999    .0071308
           hhsize |   .0011751   .0018756     0.63   0.531    -.0025011    .0048513
           couple |  -.0032724   .0055602    -0.59   0.556    -.0141702    .0076255
            _cons |   .0012495   .0136875     0.09   0.927    -.0255775    .0280766
-----------------------------------------------------------------------------------
Instrumented:  w005_hmtrio_sqcgr
Instruments:   age fem dwave2 dwave3 dreg2 dreg3 dreg4 dreg5 hhsize couple
               w005_hsdtrio_incgr
Anderson-Rubin test of significance

Note: The bootstrap usually performs best when the confidence level (here, 95%)
      times the number of replications plus 1 (1000+1=1001) is an integer.
..........................

Wild bootstrap, null imposed, 1000 replications, Anderson-Rubin Wald test, bootstrap clustering by nohhold, Rademacher weig
> hts:
  w005_hmtrio_sqcgr

                                           z =     5.1384
                                    Prob>|z| =     0.0150

95% confidence set for null hypothesis expression: [.3339, 1.219]
F-test first stage
(running regress on estimation sample)

Bootstrap replications (1000)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250
..................................................   300
..................................................   350
..................................................   400
..................................................   450
..................................................   500
..................................................   550
..................................................   600
..................................................   650
..................................................   700
..................................................   750
..................................................   800
..................................................   850
..................................................   900
..................................................   950
..................................................  1000

Linear regression                               Number of obs      =      2791
                                                Replications       =      1000
                                                Wald chi2(11)      =     16.10
                                                Prob > chi2        =    0.1376
                                                R-squared          =    0.0264
                                                Adj R-squared      =    0.0225
                                                Root MSE           =    0.0662

                                    (Replications based on 1495 clusters in nohhold)
------------------------------------------------------------------------------------
                   |   Observed   Bootstrap                         Normal-based
 w005_hmtrio_sqcgr |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
w005_hsdtrio_incgr |   .2099668   .1092324     1.92   0.055    -.0041248    .4240584
               age |  -.0000303   .0000738    -0.41   0.681    -.0001748    .0001143
               fem |    .000141   .0030907     0.05   0.964    -.0059166    .0061986
            dwave2 |   -.000349    .002699    -0.13   0.897     -.005639    .0049411
            dwave3 |   .0007538    .002939     0.26   0.798    -.0050065    .0065141
             dreg2 |  -.0026951   .0043314    -0.62   0.534    -.0111844    .0057943
             dreg3 |  -.0074719   .0045302    -1.65   0.099     -.016351    .0014072
             dreg4 |  -.0029832   .0045152    -0.66   0.509    -.0118328    .0058664
             dreg5 |  -.0022708   .0052595    -0.43   0.666    -.0125792    .0080376
            hhsize |   .0017817   .0015057     1.18   0.237    -.0011695    .0047328
            couple |  -.0068925   .0041378    -1.67   0.096    -.0150024    .0012174
             _cons |   .0135977   .0082408     1.65   0.099    -.0025539    .0297493
------------------------------------------------------------------------------------
Hausman test for endogeneity
(running regress on estimation sample)

Bootstrap replications (1000)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250
..................................................   300
..................................................   350
..................................................   400
..................................................   450
..................................................   500
..................................................   550
..................................................   600
..................................................   650
..................................................   700
..................................................   750
..................................................   800
..................................................   850
..................................................   900
..................................................   950
..................................................  1000

Linear regression                               Number of obs      =      2791
                                                Replications       =      1000
                                                Wald chi2(12)      =     50.19
                                                Prob > chi2        =    0.0000
                                                R-squared          =    0.1986
                                                Adj R-squared      =    0.1952
                                                Root MSE           =    0.0802

                                   (Replications based on 1495 clusters in nohhold)
-----------------------------------------------------------------------------------
                  |   Observed   Bootstrap                         Normal-based
 w005_hpconch_nyr |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
w005_hmtrio_sqcgr |   .8618554   .2597724     3.32   0.001     .3527109       1.371
              age |  -9.11e-06   .0001146    -0.08   0.937    -.0002338    .0002156
              fem |  -.0002156   .0034568    -0.06   0.950    -.0069909    .0065597
           dwave2 |   -.004661   .0033592    -1.39   0.165    -.0112449    .0019228
           dwave3 |    .006429   .0033047     1.95   0.052    -.0000481    .0129061
            dreg2 |  -.0009737   .0055243    -0.18   0.860    -.0118012    .0098537
            dreg3 |  -.0051889   .0064375    -0.81   0.420    -.0178061    .0074283
            dreg4 |   .0040633   .0057619     0.71   0.481    -.0072299    .0153564
            dreg5 |  -.0053846   .0060132    -0.90   0.371    -.0171701     .006401
           hhsize |   .0011751   .0017754     0.66   0.508    -.0023047    .0046548
           couple |  -.0032724   .0049963    -0.65   0.512     -.013065    .0065203
            resid |  -.2857863   .2585563    -1.11   0.269    -.7925473    .2209747
            _cons |   .0012495    .010535     0.12   0.906    -.0193986    .0218977
-----------------------------------------------------------------------------------

. *set trace on
.          
. global l3 ${treat} ${l2}         

. local nl3: word count ${l3} _cons         

. assert `nl3' == ${nc}         

. 
. *Saving matrix of regression results as a text file            
. matrix A_sp${k}_t${tv}_o${on}=J(${nc${nsp}}+2+${nb}+${naddsc}+1,${ncol}+1,.)            

.          
. *Putting in the coefficients and std errors of the estimation        
. local nn = ${nc${nsp}}+2      

. forvalues m=1/`nn' {         
  2. 
.       if `m'<=${nc}-1 {      
  3.          local l=`m'      
  4.       }      
  5.       else if `m'==`nn' {      
  6.          local l=${nc}      
  7.       }      
  8.          
.       if (`m'<=${nc}-1 | `m'==`nn') {      
  9.          matrix A_sp${k}_t${tv}_o${on}[`m',1] = olco[1,`l']         
 10.          matrix A_sp${k}_t${tv}_o${on}[`m',2] = sqrt(olvar[`l',`l'])         
 11.          matrix A_sp${k}_t${tv}_o${on}[`m',3] = ///      
>             A_sp${k}_t${tv}_o${on}[`m',1]/A_sp${k}_t${tv}_o${on}[`m',2]         
 12.          matrix A_sp${k}_t${tv}_o${on}[`m',4] = ///      
>             2*ttail(nobs - ${nc},abs(A_sp${k}_t${tv}_o${on}[`m',3]))         
 13.          matrix A_sp${k}_t${tv}_o${on}[`m',5] = ///      
>             A_sp${k}_t${tv}_o${on}[`m',1] - invttail(nobs - ${nc},sigl/2)*A_sp${k}_t${tv}_o${on}[`m',2]         
 14.          matrix A_sp${k}_t${tv}_o${on}[`m',6] = ///      
>             A_sp${k}_t${tv}_o${on}[`m',1] + invttail(nobs - ${nc},sigl/2)*A_sp${k}_t${tv}_o${on}[`m',2]         
 15.       }      
 16. }         

. 
. *Adding various additional estimates      
. forvalues ad=1/$naddsc {      
  2.    local adv: word `ad' of ${addsc}      
  3.    matrix A_sp${k}_t${tv}_o${on}[${nc${nsp}}+2+${nb}+`ad',1]=`adv'        
  4. }      

. *Labels of matrix of regression output   
. *Column labels       
. local cnn ""         

. foreach nm in $col {         
  2.    local cnn `cnn' `nm'_${mth}_sp${k}         
  3. }         

.          
. matrix colnames A_sp${k}_t${tv}_o${on} = `cnn' blank             

.          
. *Row labels         
. local bl 

. forvalues bbl=1/$nb {         
  2.    local bl `bl' blank         
  3. }

. 
. local rn ${treat} ${spf${nsp}} _cons `bl' ${addsc}

. local rn2 ""

. foreach var in `rn' {
  2.    local rn2 `rn2' ${ol}_`var'
  3. }

. matrix rownames A_sp${k}_t${tv}_o${on} = `rn2' blank         

.          
. 
. 
end of do-file
